#include <stdio.h>

int main()
{
	unsigned long long n = 600851475143;
	unsigned long long divisor;
	
	for(divisor = 2; divisor < n; divisor++)
	{
		if(n % divisor == 0)
		{
			n /= divisor;
		}
	}
	
	printf("%llu\n", n);
	
	return 0;
}
